package cn.yuanqiao.archive.storeRoom.mapper;

import cn.yuanqiao.archive.storeRoom.domain.StoreRole;
import cn.yuanqiao.archive.storeRoom.domain.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 库房权限Mapper接口
 *
 * @author xy
 * @date 2023-06-20
 */
@Mapper
public interface StoreRoleMapper
{
    /**
     * 查询库房权限
     *
     * @param storeId 库房权限主键
     * @return 库房权限
     */
    StoreRole selectStoreRoleByStoreId(Long storeId);

    /**
     * 查询库房权限列表
     *
     * @param storeRole 库房权限
     * @return 库房权限集合
     */
    List<StoreRole> selectStoreRoleList(@Param("storeRole") StoreRole storeRole, @Param("userIdList") List<Long> userIdList, @Param("code") String code);

    /**
     * 新增库房权限
     *
     * @param storeRole 库房权限
     * @return 结果
     */
    int insertStoreRole(StoreRole storeRole);

    /**
     * 修改库房权限
     *
     * @param storeRole 库房权限
     * @return 结果
     */
    int updateStoreRole(StoreRole storeRole);

    /**
     * 删除库房权限
     *
     * @param storeId 库房权限主键
     * @return 结果
     */
    int deleteStoreRoleByStoreId(StoreRole storeRole);

    /**
     * 批量删除库房权限
     *
     * @param storeIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteStoreRoleByStoreIds(@Param("storeIds") Long[] storeIds, @Param("code") String code);

    List<UserRole> selectStoreUserList(@Param("code") String code);

    List<Long> getStoreUserList(@Param("storeId") Long storeId, @Param("code") String code);
}
